package org.gjy.m8.thread;

import org.junit.Test;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-12-08 11:40:02
 */
public class ThreadPoolTest {

    @Test
    public void test1() {
        int processors = Runtime.getRuntime().availableProcessors();
        ThreadPoolExecutor pool = new ThreadPoolExecutor(
                processors,
                processors * 2,
                2,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(processors)
                , Executors.defaultThreadFactory()
                , new ThreadPoolExecutor.AbortPolicy()
        );
    }
}
